#!/bin/sh
rr=$(date +%s)

#sleep 30

while true
do
#ping -c 3 -w 3  192.168.234.1 >> /dev/null
ping -c 3 -w 3  192.168.234.240 >> /dev/null
if [ $? -eq 0 ];then
        echo "eth1 network is ready"
        sleep 3
else
	echo "eth1 network is not ready"
	current_time=$(date "+%Y%m%d-%H%M%S")
	#echo $current_time > /opt/CameraData/log/error-$rr-$current_time.log
	#dmesg >> /opt/CameraData/log/error-$rr-$current_time.log
	echo $current_time > error-$rr-$current_time.log
	dmesg >> error-$rr-$current_time.log

        sleep 3
fi
done
